package com.ruoyi.echarts.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.echarts.domain.ActivitySign;
import com.ruoyi.echarts.domain.BookStore;
import com.ruoyi.echarts.domain.OrdersNum;
import com.ruoyi.echarts.domain.Post;
import com.ruoyi.echarts.mapper.EchartsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/echarts/echarts")
public class EchartsController {
    @Autowired
    private EchartsMapper echartsMapper;
    @GetMapping("/echart1")
    public AjaxResult echart1(){
        List<OrdersNum> list = echartsMapper.echart1();
        return AjaxResult.success(list);
    }

    @GetMapping("/echart2")
    public AjaxResult echart2(){
        List<ActivitySign> list = echartsMapper.echart2();
        return AjaxResult.success(list);
    }

    @GetMapping("/echart3")
    public AjaxResult echart3(){
        List<Post> list = echartsMapper.echart3();
        return AjaxResult.success(list);
    }

    @GetMapping("/echart4")
    public AjaxResult echart4(){
        List<BookStore> list = echartsMapper.echart4();
        return AjaxResult.success(list);
    }
}
